<?php

require_once('PHPUnit/Framework.php');
require_once('../IntranetAddress.inc');

class IntranetAddressExceptionTest extends PHPUnit_Framework_TestCase {

    public function testNoIncludedCIDR() {
        try {
            $ia = new IntranetAddress('empty.inc');
        }
        catch ( Exception $e ) {
            $this->assertRegexp( '/ \' included_intranet_cidr_list \' \s not \s found \s in /ixms', $e->getMessage() );
        }
    }
 
    public function testNoExcludedCIDR() {
        try {
            $ia = new IntranetAddress('no_excluded.inc');
        }
        catch ( Exception $e ) {
            $this->assertRegexp( '/ \' excluded_intranet_cidr_list \' \s not \s found \s in /ixms', $e->getMessage() );
        }
    }
 
    public function testInvalidCIDR() {
        try {
            $ia = new IntranetAddress('invalid.inc');
        }
        catch ( Exception $e ) {
            $this->assertRegexp( '/ could \s not \s parse /ixms', $e->getMessage() );
        }
    }
 
}
?>
